<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.partner.prepay.role.form.Menu"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>主菜单</title>
		<%@ include file="/easyprepay/jsp/common/head.jsp"%>
		<%@ taglib uri="/easyprepay" prefix="easy"%>
		<script type="text/javascript">
			function addFunction(){
				location.href="<%=basePath%>easyprepay/jsp/role/addFunction.jsp";
			}
			function delFunction(functionId,functionName){
				if (confirm("您确定要删除"+" "+functionName+"?")){
				
				location.href="<%=basePath%>userRole.do?method=delFunction&functionId="+functionId;
			}else{
				
			}
				
			}
			
		</script>

	</head>

	<body>
		权限设置
		<hr>
		<table border=1 width=100%>
			<tr>
				<td>
					编号
				</td>
				<td>
					权限名称
				</td>
				<td colspan="2">
					主菜单设置
				</td>
			</tr>
			<%
				//获取主菜单集合
				List<Function> function = (List<Function>) request.getAttribute("function");
				int s = function.size();
				for (int i = 0; i < s; i++) {
			%>
			<tr>
				<td><%=i + 1%></td>
				<td><%=function.get(i).getFunctionName()  %></td>
				
				<td>
					<input type="button" value="删除权限"
						onclick='delFunction("<%=function.get(i).getId()%>","<%= function.get(i).getFunctionName()  %>")'>
				</td>
			</tr>
			<%
				}
			%>
			<tr>
				<td colspan="4" align="right">
					<input type="button" value="添加权限" onclick="addFunction()">
				</td>
		</table>
	</body>
</html>
